#include "Box2dCircleShape.h"
#include  <Box2D/Box2D.h>

namespace physics {

	Box2dCircleShape::Box2dCircleShape( b2CircleShape* circleShape ) :
	_circleShape( circleShape ) {
	}

	Box2dCircleShape::~Box2dCircleShape( ) {
	}

	float Box2dCircleShape::GetRadius( ) const {
		return _circleShape->m_radius;
	}

	void Box2dCircleShape::SetRadius( float radius ) {
		_circleShape->m_radius = radius;
	}

	Transform Box2dCircleShape::GetPos( ) const {
		b2Vec2 vec = _circleShape->m_p;
		return Transform( Vec2( vec.x, vec.y ), 0.0f );
	}

	void Box2dCircleShape::SetPos( Transform pos ) {
		_circleShape->m_p = b2Vec2( pos.Vec.X, pos.Vec.Y );
	}

	const b2Shape* Box2dCircleShape::GetBox2dShape( ) const {
		return _circleShape;
	}

	void Box2dCircleShape::Accept( const IShapeVisitor* visitor ) const {
		visitor->VisitCircle(this);
	}
}
